home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / AppleTalk Remote access / Scripts ARA ƒ / Telebit T2500 / Telebit T2500
Encoding:
Text File  |  1991-12-17  |  3.2 KB  |  201 lines  |  [mlts/slnk]

  1. @ORIGINATE
  2. @ANSWER
  3. !
  4. serreset 9600, 0, 8, 1
  5. !
  6. ! first recall the factory configuration, and get the modem in enhanced command state
  7. !
  8. settries 0
  9. matchclr
  10. @LABEL 1
  11. matchstr 1 3 "OK\13\10"
  12. matchstr 2 2 "ERROR\13\10"
  13. write "AT~&F0\13"
  14. matchread 20
  15. !
  16. @LABEL 2
  17. matchclr
  18. matchstr 1 3 "OK\13\10"
  19. write "AT&F0\13"
  20. matchread 20
  21. inctries
  22. iftries 2 59
  23. ! Modem is not responding, reset and send a break
  24. DTRClear
  25. pause 5
  26. DTRSet
  27. SBreak
  28. jump 1
  29. !
  30. ! Turn echo off, retrain after line is bad for 1 second, turn off flow control.
  31. !
  32. @LABEL 3
  33. matchclr
  34. matchstr 1 4 "OK\13\10"
  35. write "ATE0S123=20S50=6\13"
  36. matchread 30
  37. jump 59
  38. !
  39. ! Reset when DTR is dropped
  40. !
  41. @LABEL 4
  42. matchstr 1 5 "OK\13\10"
  43. write "ATS52=2\13"
  44. matchread 30
  45. jump 59
  46. !
  47. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  48. @LABEL 5
  49. ifstr 2 8 "1"
  50. matchstr 1 8 "OK\13\10"
  51. write "ATM0\13"
  52. matchread 30
  53. jump 59
  54. !
  55. ! The modem is ready so enable answering, or originate a call
  56. !
  57. @LABEL 8
  58. ifANSWER 30
  59. note "Dialing ^1" 3
  60. write "ATS0=0DT^1\13"
  61. !
  62. @LABEL 9
  63. matchstr  1 11 "CONNECT 1200\13\10"
  64. matchstr  2 12 "CONNECT 2400\13\10"
  65. matchstr  3 13 "CONNECT 4800\13\10"
  66. matchstr  4 14 "CONNECT 9600\13\10"
  67. matchstr  5 15 "CONNECT FAST\13\10"
  68. matchstr  6 50 "NO CARRIER\13\10"
  69. matchstr  7 50 "ERROR\13\10"
  70. matchstr  8 52 "NO DIALTONE\13\10"
  71. matchstr  9 53 "BUSY\13\10"
  72. matchstr 10 54 "NO ANSWER\13\10"
  73. matchread 700
  74. jump 59
  75. !
  76. @LABEL 11
  77. note "Communicating at 1200 bps." 2
  78. setspeed 1200
  79. jump 16
  80. !
  81. @LABEL 12
  82. note "Communicating at 2400 bps." 2
  83. setspeed 2400
  84. jump 16
  85. !
  86. @LABEL 13
  87. note "Communicating at 4800 bps." 2
  88. setspeed 4800
  89. jump 16
  90. !
  91. @LABEL 14
  92. note "Communicating at 9600 bps." 2
  93. setspeed 9600
  94. jump 16
  95. !
  96. @LABEL 15
  97. note "Communicating at 19.2 kbps." 2
  98. setspeed 19200
  99. !
  100. @LABEL 16
  101. ifANSWER 17
  102. pause 30
  103. @LABEL 17
  104. exit 0
  105. !
  106. ! @ANSWER
  107. ! Set up the modem to answer
  108. @LABEL 30
  109. write "ATS0=1\13"
  110. matchstr 1 31 "OK\13\10"
  111. matchread 30
  112. jump 59
  113. !
  114. @LABEL 31
  115. matchstr 1  32 "RING\13\10"
  116. matchstr 2  11 "CONNECT 1200\13\10"
  117. matchstr 3  12 "CONNECT 2400\13\10"
  118. matchstr 4  13 "CONNECT 4800\13\10"
  119. matchstr 5  14 "CONNECT 9600\13\10"
  120. matchstr 6  15 "CONNECT FAST\13\10"
  121. matchstr 7  50 "NO CARRIER\13\10"
  122. matchstr 8  50 "ERROR\13\10"
  123. matchstr 9  52 "NO DIALTONE\13\10"
  124. matchstr 10 53 "BUSY\13\10"
  125. matchstr 11 54 "NO ANSWER\13\10"
  126. matchread 700
  127. jump 31
  128. !
  129. @LABEL 32
  130. userhook 1
  131. note "Answering phone…" 2
  132. jump 31
  133. !
  134. ! 50: error messages
  135. !
  136. ! No carrier error
  137. @LABEL 50
  138. exit -6021
  139. !
  140. ! No dial tone error
  141. @LABEL 52
  142. exit -6020
  143. !
  144. ! Line busy error
  145. @LABEL 53
  146. exit -6022
  147. !
  148. ! No answer error
  149. @LABEL 54
  150. exit -6023
  151. !
  152. ! Modem error
  153. @LABEL 59
  154. exit -6019
  155. !
  156. ! Hang up the modem
  157. !
  158. @HANGUP
  159. @LABEL 60
  160. settries 0
  161. @LABEL 61
  162. matchclr
  163. matchstr 1 62 "OK\13\10"
  164. matchstr 2 62 "NO CARRIER\13\10"
  165. matchstr 3 62 "ERROR\13\10"
  166. write "ATH\13"
  167. matchread 30
  168. inctries
  169. iftries 3 62
  170. ! no response, try escape sequence
  171. write "+++"
  172. matchclr
  173. matchstr 1 61 "OK\13\10"
  174. matchread 15
  175. !
  176. ! No response from modem, toggle DTR
  177. !
  178. DTRClear
  179. pause 5
  180. DTRSet
  181. jump 61
  182. !
  183. ! Recall the factory settings
  184. !
  185. @LABEL 62
  186. pause 5
  187. matchclr
  188. matchstr 1 63 "OK\13\10"
  189. write "AT&F0\13"
  190. matchread 30
  191. ! turn off auto answer, set S51 so modem will check interface speed on next command
  192. @LABEL 63
  193. pause 5
  194. write "ATS0=0S51=255\13"
  195. matchstr 1 64 "OK\13\10"
  196. matchread 30
  197. !
  198. @LABEL 64
  199. exit 0
  200.  
  201.